// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   DBConnFactory.java

package com.vandagroup.common.treedic;

import java.io.PrintStream;
import java.sql.Connection;
import java.sql.SQLException;

// Referenced classes of package com.vandagroup.common.treedic:
//            DBConnection

public class DBConnFactory
{

    static DBConnection dbConn;

    public DBConnFactory()
    {
    }

    public static synchronized Connection getConnection()
        throws ClassNotFoundException, SQLException
    {
        return dbConn.getConnection();
    }

    public static synchronized void freeConnection(Connection conn)
    {
        dbConn.freeConnection(conn);
    }

    static 
    {
        String connImpleClass = "com.vandagroup.common.treedic.DefaultDBConnImpl";
        try
        {
            System.out.println("Connection class name::" + connImpleClass);
            Class dbClass = Class.forName(connImpleClass);
            Object dbObj = dbClass.newInstance();
            dbConn = (DBConnection)dbObj;
        }
        catch(Exception e)
        {
            System.out.println("DBConnection class Not Found, please check the configration file");
        }
    }
}
